from collections import Counter

a = "kjalfj;ldsjafl;hdsllfdhg;lahfbl;hl;ahlf;hw"
print(Counter(a))

# 方法二：
t1 = set([i for i in a])
for i in t1:
    print(i, a.count(i))
